# include <iostream>
using namespace std;

template <const int s> class IntegerVector{
		int a[s];	

		public:
			typedef  int vector_int;
			IntegerVector(){
				for (int i=0; i<s; i++)
						cin >> a[i];
			}

			~IntegerVector(){
				// delete a[s];
			}

			IntegerVector(int* v){
				for (int i=0; i<s; i++)
						a[i]=*(v+i);
			}

			IntegerVector<s> plus(const IntegerVector<s> V2){
					int v[s];
					for (int i=0; i<s; i++)
						v[i]=a[i]+V2.a[i];
					return v;	
			}

			 friend int dot_product(const IntegerVector<s> V2, IntegerVector<s> V1){
					int prod=0;
					for (int i=0; i<s; i++)
						prod+=V1.a[i]*V2.a[i];
					return prod;	
			}
		static vector_int to_vector_int(const int& i) {return i;}
};



struct name{
	int ch;

	typedef IntegerVector<ch> type;

	name(i=3) : ch(i){}
};

// template<const int& t> IntegerVector<t>::vector_int operator+(const IntegerVector<t>::vector_int& i, const IntegerVector<t>::vector_int& j){return IntegerVector<t>::to_vector_int(i+j);}

int main(){
	int a[]={1,2,3};
	IntegerVector<2> V1(a),V2(a);
	IntegerVector<2>::vector_int i=IntegerVector<2>::to_vector_int(0),j=IntegerVector<2>::to_vector_int(3);
	name N;
	V1.plus(V2);
		cout << dot_product(V1,V2) << endl;
	IntegerVector<3> V3(a);
	IntegerVector<3>::vector_int l=4;
	cout << i+j << endl;
	cout << i+j << endl;
	/* V3.plus(V2);*/ // error because of the template parameter does not match
	return 0;
}
